package com.practice;

public class OpenPsd {
    public static void main(String[] args) {
        //由AddPsd反转进行解密

        int psd = 8346;
        int temp = 0;
        int temp1=0;
        while (psd != 0) {
            int ge = psd % 10;
            //反转
            temp = temp * 10 + ge;
//            System.out.println(temp);
            //+10 倒退 因为+5%10等于现在的数 所以倒退回去不可能单位超过20
            //即5 6 7 8 9不需要加10
            ge=temp%10;
            if (ge >= 0 && ge <= 4) {
                ge += 10;
            }
            ge -= 5;
            temp1=temp1*10+ge;
            psd /= 10;
        }
        System.out.println(temp1);
    }
}
